package util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import negocio.Empresa;

public class SecurityHelper {
	
	public static boolean validarEntradaIdSession(HttpServletRequest request){
		
		HttpSession session = request.getSession();
		
		Empresa emp = (Empresa) session.getAttribute("usuarioEmpresa");
		
		int idRequest = Integer.parseInt(request.getParameter("idEmpresa"));
		int idSession = emp.getId();
		if(idRequest == idSession){
			return true;
		}
		else{
			return false;
		}
	}

}
